package net.madarco.phpsense;

import net.madarco.phpsense.util.EclipseConsole;
import net.madarco.phpsense.util.Logger;
import net.madarco.phpsense.util.QuercusEnviroment;

import org.eclipse.php.core.codeassist.ICompletionContext;
import org.eclipse.php.core.codeassist.ICompletionContextResolver;
import org.eclipse.php.internal.core.codeassist.contexts.CompletionContextResolver;

public class ContextResolver extends CompletionContextResolver implements ICompletionContextResolver {
	private static final Logger log = new Logger();

	private static EclipseConsole console = new EclipseConsole();

	private QuercusEnviroment quercusUtil;
	
	public ContextResolver() {
		quercusUtil = new QuercusEnviroment("phpSense.php", console, true);
		
		console.trace("PhpSense ContextResolver started");
	}
	

    public ICompletionContext[] createContexts() {
        return new ICompletionContext[] { new CompletionContext(this.quercusUtil) };
    }
}